package com.zzyl.nursing.service.member.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzyl.nursing.dto.member.QueryDTO;
import com.zzyl.nursing.mapper.member.MemberOrdersProjectMapper;
import com.zzyl.nursing.service.member.IMemberOrdersProjectService;
import com.zzyl.serve.domain.NursingProject;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 小程序服务项实现类
 *
 * @author makangkang
 * @date 2025/10/22 21:37
 */
@Service
public class IMemberOrdersProjectServiceImpl extends ServiceImpl<MemberOrdersProjectMapper, NursingProject> implements IMemberOrdersProjectService {

    private static final int ENABLE = 1;

    /**
     * 分页查询护理项目列表
     *
     * @param queryDTO
     * @return
     */
    @Override
    public List<NursingProject> getPage(QueryDTO queryDTO) {
        return this.lambdaQuery().like(StrUtil.isNotBlank(queryDTO.getName()), NursingProject::getName, queryDTO.getName()).eq(NursingProject::getStatus, ENABLE).list();
    }

    /**
     * 根据编号查询护理项目信息
     *
     * @param id
     * @return
     */
    @Override
    public NursingProject getNursingProjectByid(Long id) {
        return this.getById(id);
    }
}
